home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 14 / Example 14.1 / action.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-30  |  736 b   |  38 lines

  1. #ifndef _RTS_AI_ACTION_
  2. #define _RTS_AI_ACTION_
  3.  
  4. #include <vector>
  5. #include "intpoint.h"
  6. #include "building.h"
  7. #include "unit.h"
  8.  
  9. class PLAYER;
  10.  
  11. class AI_ACTION
  12. {
  13.     public:
  14.         virtual AI_ACTION* RequiresAction(PLAYER *player) = 0;
  15.         virtual void PerformAction(PLAYER *player) = 0;
  16. };
  17.  
  18. class TRAIN_UNIT : public AI_ACTION
  19. {
  20.     public:
  21.         TRAIN_UNIT(int unitType);
  22.         AI_ACTION* RequiresAction(PLAYER *player);
  23.         void PerformAction(PLAYER *player);
  24.     private:
  25.         int m_unitToTrain;
  26. };
  27.  
  28. class CONSTRUCT_BUILDING : public AI_ACTION
  29. {
  30.     public:
  31.         CONSTRUCT_BUILDING(int buildingType);
  32.         AI_ACTION* RequiresAction(PLAYER *player);
  33.         void PerformAction(PLAYER *player);
  34.     private:
  35.         int m_buildingToMake;
  36. };
  37.  
  38. #endif